package mini_v340

import io.gatling.core.Predef._
import io.gatling.core.structure.ChainBuilder
import io.gatling.http.Predef._
import conf._
/**
  * Created by chenbo on 2018/9/6.
  */
object Order {

  def order_list():ChainBuilder={

    val a:Map[String,Any]=Map(
      "pageIndex"->"1",
      "pageSize"->"10",
      "type"->"0"
    )

    exec(
      Request.get(Config.OrderList,a)
        .check( jsonPath("$..msg").is("success"))
        .check( jsonPath("$.value[0].sysNo").saveAs("sysNo"))
    )
  }

  def order_detail(sysNo:String):ChainBuilder={
    val a:Map[String,Any]=Map(
      "areaSysNo"->Apply.apply.area,
      "orderSysNo"->sysNo,
      "soType"->"1"
    )

    exec(
      Request.get(Config.Order,a)
        .check( jsonPath("$..msg").is("success"))
    )
  }
}
